package com.hmall.api;

import com.hmall.common.utils.UserContext;
import feign.RequestInterceptor;

/**
 * @Author 86157
 * @Date 2025/9/2 下午7:51
 */
public class FeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(feign.RequestTemplate template){
        Long userId = UserContext.getUser();
        if(userId != null){
            template.header("user-info", UserContext.getUser().toString());
        }
    }
}
